#pragma once
#include"ggl.h"

struct UniformTexture
{
	GLuint mLocation;
	GLuint mTexture;
public:
	UniformTexture(){

		mLocation = -1;
		mTexture = 0;
	}
};

class shader
{
public:
	shader();
	~shader();
	void Init(const char* vsShader, const char* fsShader);
	void Bind(float * M, float * V, float * P);
	void SetTexure(const char * name, const char* texturePath);
	void SetCameraPos(float x, float y, float z);
private :
	GLuint CompileShader(GLenum shaderType, const char*shaderPath);
	GLuint CreateGPUProgram(GLuint vsShader, GLuint fsShader);
	
public:
	GLuint mProgram;
	//UniformTexture mTexture;
	std::map<std::string, UniformTexture*> mUniformTextures;
	GLuint mModelMatrixLocation, mViewMatrixLocation, mProjectionMatrixLocation,NormalMatrixLocation;
	GLuint  mPositionLocation, mColorLocation, mNormalLocation, mTexcoordLocation;
	GLuint   mCameraPosLocation;
	
};

